package com.ITArmy.dao;

import com.ITArmy.beans.Collections;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CollectionsMapper {
    int deleteByPrimaryKey(Long coId);

    int insert(Collections record);

    int insertSelective(Collections record);

    Collections selectByPrimaryKey(Long coId);

    int updateByPrimaryKeySelective(Collections record);

    int updateByPrimaryKey(Collections record);

    //根据用户id遍历所有的收藏信息
    List<Collections> selectAllCollectionChapterId(long uId);

    //用户删除收藏的博客
    int deleteCollectionBlog(@Param("uId")long uId, @Param("blogId")long blogId);

    //用户删除收藏得连载
    int deleteCollectionSerilaize(@Param("uId")long uId, @Param("serializeId")long serializeId);

    /**
     * 删除所有博客id对应的收藏信息
     *
     * @param bid bid
     * @return int
     */
    int deleteCollectionByBid(long bid);

    /**
     * 查询用户是否收藏过这篇博客
     */
    int checkCollection(@Param("uId") long uId, @Param("bId") long bId);
}